package com.my.chapter8;

public class practice15 {
    public static void main(String[] args) {
        PolyConstructors.main(args);
    }
}

class Glyph{
    void draw() {
        System.out.println("Glyph.draw()");
    }
    Glyph(){
        System.out.println("Glyph() before draw()");
        draw();
        System.out.println("Glyph() after draw()");
    }
}
class RectangleGlyph extends Glyph{
    private int ra=1;
    RectangleGlyph(int r){
        System.out.println("RectangleGlyph(),ra="+ra);
    }
    void draw() {
        System.out.println("RectangleGlyph(),ra="+ra);
    }
}
class RoundGlyph extends Glyph{
    private int radius=1;
    RoundGlyph(int r){
        radius=r;
        System.out.println("RoundGlyph.RoundGlyph(),radius="+radius);
    }
    void draw() {
        System.out.println("RoundGlyph.draw(),radius="+radius);
    }
}

class PolyConstructors {
    public static void main(String[] args) {
        new RectangleGlyph(5);
    }
}

